#ifndef SCREENSHOT_H
#define SCREENSHOT_H

#include <QDialog>
#include <QPushButton>

class ScreenShot: public QDialog
{
    Q_OBJECT
public:
    ScreenShot(QScreen *screen, QPoint startPoint, QPoint endPoint, WId windowId, int index, QWidget *parent = nullptr);

protected:
    void showEvent(QShowEvent *event);
    void paintEvent(QPaintEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseDoubleClickEvent(QMouseEvent* event);

private:
    QScreen *screen;
    WId windowId;
    int index;
    bool isPressed = true;
    QPoint startPoint, endPoint;
    QPixmap fullScreenBack;
    QPixmap fullScreenDisplay;
    QPushButton *fullScreenButton;
    QRect getCapturedRect();
    void confirmRect();

signals:
    void rectConfirmed(QRect rect, int index);
};

#endif // SCREENSHOT_H
